﻿using System.Windows.Controls;
using System.Windows.Media;
using Kindohm.KSynth.Library;

namespace Kindohm.KSynth.AudioCanvas
{
    public partial class PanControl : UserControl, ICanvasControl
    {
        Panner panner;

        public PanControl()
        {
            InitializeComponent();
            this.Loaded += new System.Windows.RoutedEventHandler(PanControl_Loaded);
        }

        void PanControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            this.panSlider.Minimum = short.MinValue;
            this.panSlider.Maximum = short.MaxValue;
        }

        public TranslateTransform Translation
        {
            get { return this.translation; }
        }

        public Panner Panner
        {
            get { return this.panner; }
            set
            {
                this.panner = value;
                this.panner.SetPan(this.panSlider, Slider.ValueProperty);
            }
        }
    }
}
